﻿using System;
using System.Collections.Generic;
using System.Text;
using OpenTK;
using OpenTK.Graphics;

namespace LasRendering
{
    public class QuadTreeNode
    {
        public QuadTreeNode(float northBound, float southBound, float eastBound, float westBound)
        {
            this.NorthBound = northBound;
            this.SouthBound = southBound;
            this.EastBound = eastBound;
            this.WestBound = westBound;
            this.CenterPosition = new Vector2((eastBound + westBound) / 2, (northBound + southBound) / 2);
        }

        //     y
        //     ^
        //  NW | NE 
        // --- c --> x
        //  SW | SE
        //     |

        public float NorthBound;
        public float SouthBound;
        public float EastBound;
        public float WestBound;
        public Vector2 CenterPosition;
        public QuadTreeNode NorthEastChild;
        public QuadTreeNode NorthWestChild;
        public QuadTreeNode SouthEastChild;
        public QuadTreeNode SouthWestChild;
        public List<QuadTreeNode> NeighborNodes;
        public QuadTreeVertexIndexLink VertexIndexLink;
        public QuadTreeVertexIndexLink NeighborVertexIndexLink;
        public VisibleQuadTreeNode VisibleNode;

        public int MemLockCount;
        public int GpuLockCount;
        public VertexBucket IndexVertexBucket;
        public Color4[] ColorList;
    }
}
